﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="DanhMucNguoiDung.ascx.cs" Inherits="QuanLyDeTaiKHCN.UserControls.DanhMucNguoiDung" %>
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<asp:UpdatePanel ID="udt1" runat="server">
    <ContentTemplate>
        <div style="float:left;width:40%;">
            <div class="control-group info">
                <label class="control-label" style="padding-right: 10px;">Họ và tên</label>
                <div class="controls">
                    <asp:TextBox ID="txtTenHienThi" runat="server" CssClass="span3" onblur="KiemTraInjection(this);"></asp:TextBox>
                </div>
                <div style="height:5px;"></div>
                <label class="control-label" style="padding-right: 10px;">Tên đăng nhập</label>
                <div class="controls">
                    <asp:TextBox ID="txtTenDangNhap" runat="server" CssClass="span3" onblur="KiemTraInjection(this);"></asp:TextBox>
                </div>
                <div style="height:5px;"></div>
                <label class="control-label" style="padding-right: 10px;">Mật khẩu đăng nhập</label>
                <div class="controls">
                    <asp:TextBox ID="txtMatKhauDangNhap" runat="server" CssClass="span3" TextMode="Password" onblur="KiemTraInjection(this);"></asp:TextBox>
                </div>
                <div style="height:5px;"></div>
                <label class="control-label" style="width:160px;padding-right:10px;">Cấp quyền đăng nhập</label>
                <div class="controls">
                    <asp:CheckBox ID="chkgrant" runat="server" />
                </div>
                <div style="height:5px;clear:both;"></div>
                <label class="control-label" style="padding-right: 10px;"></label>
                <div class="controls">
                    <asp:LinkButton ID="btnadd" OnClick="btnadd_Click" class="btn btn-primary"  runat="server"><i class=" icon-plus"></i>&nbsp;&nbsp;Thêm mới</asp:LinkButton>
                    <asp:LinkButton ID="btnsave" class="btn btn-primary" OnClick="btnsave_Click"  runat="server"><i class=" icon-save"></i>&nbsp;&nbsp;Lưu</asp:LinkButton>
                    <br /><asp:Label ID="lblstatus" runat="server" ForeColor="Red"></asp:Label>
                    <input type="hidden" runat="server" id="txtid" />
                </div>
            </div>
        </div>
        <div style="float:left;width:59%;">
            <asp:GridView ID="grid" runat="server" AutoGenerateColumns="false" DataKeyNames="ID" ForeColor="#333333" GridLines="None" OnRowCommand="grid_RowCommand">
                <AlternatingRowStyle BackColor="White" />
                <Columns>
                    <asp:TemplateField HeaderText="Tên Hiển thị">
                        <ItemTemplate>
                            <asp:Label ID="lblTenHienThi" runat="server" Text='<%# Bind("TenHienThi") %>'></asp:Label>
                        </ItemTemplate>
                        <ItemStyle CssClass="ItemGridCell" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Tài Khoản Đăng Nhập">
                        <ItemTemplate>
                            <asp:Label ID="lblTaiKhoanDangNhap" runat="server" Text='<%# Bind("TenDangNhap") %>'></asp:Label>
                            <asp:CheckBox ID="chkPhanQuyen" runat="server" Checked='<%# Bind("PhanQuyen") %>' Visible="false"></asp:CheckBox>
                        </ItemTemplate>
                        <ItemStyle CssClass="ItemGridCell" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Chọn">
                        <ItemTemplate>
                            <asp:LinkButton ID="LinkChon" runat="server" CausesValidation="false" 
                                CommandName="ChonTaiKhoan" CommandArgument='<%# ((GridViewRow) Container).RowIndex %>' Text="<i class='icon-file-text-alt'></i> Chọn"></asp:LinkButton>   <%--CommandArgument='<%# ((GridViewRow) Container).RowIndex %>' de lay rowindex--%>
                        </ItemTemplate>
                        <ItemStyle CssClass="ItemGridCell" HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Xóa">
                        <ItemTemplate>
                            <asp:LinkButton ID="LinkButtonxoa" runat="server" CausesValidation="false" 
                                CommandName="DeleteAcount" CommandArgument='<%#Eval("ID") %>' Text="<i class='icon-remove red'></i> Xóa"></asp:LinkButton>
                        </ItemTemplate>
                        <ItemStyle CssClass="ItemGridCell" HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:TemplateField>
                </Columns>
                <EditRowStyle BackColor="#2461BF" />
                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                <RowStyle BackColor="#EFF3FB" />
                <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                <SortedAscendingCellStyle BackColor="#F5F7FB" />
                <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                <SortedDescendingCellStyle BackColor="#E9EBEF" />
                <SortedDescendingHeaderStyle BackColor="#4870BE" />
            </asp:GridView>
        </div>
    </ContentTemplate>
</asp:UpdatePanel>